package top.kaoshanji.p1ch01c;

import top.kaoshanji.p1ch01c.exception.BaseException;

/**
 * 代码清单 p1ch01c-02：异常消失的示例(1.4.3节)
 * 抛出的异常是 finally 子句里的 ArithmeticException 异常
 * author kaoshanji
 * ^_^
 * create time 2024/12/22 19:16
 */
public class DisappearedException {

    public void show() throws BaseException {

        try {
            Integer.parseInt("Hello");
        } catch (NumberFormatException nfe) {
            throw new BaseException(nfe);
        } finally {
            try {
                int result = 2 / 0;
            } catch (ArithmeticException ae) {
                throw new BaseException(ae);
            }

        }

    }


}
